<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateConvertFormulasTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('convert_formulas', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->bigInteger('agent_id')->index()->comment('代理商ID');
            $table->string('name', 64)->comment('合成公式名称');
            $table->bigInteger('target_product_id')->index()->comment('合成目标商品');
            $table->string('status', 16)->default(\App\Enums\AvailableStatus::DISABLED())->comment('启用状态');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('convert_formulas');
    }
}
